#ifndef COLORPANEL_H
#define COLORPANEL_H

#include <QWidget>
#include "SpinBoxWithSlider.h"
#include <QLabel>
#include <QLayout>

class ColorPanel : public QWidget
{
Q_OBJECT
public:
    explicit ColorPanel(QColor initColor = QColor(0, 0, 0), QWidget* parent = nullptr);
    ~ColorPanel() override;


public slots:
    void SetValue(const QColor& c);
    void SetTitle(const QString& t);

signals:
    void ValueChanged(const QColor& c);

private:
    QLabel* title;
    SpinBoxWithSlider* r;
    SpinBoxWithSlider* g;
    SpinBoxWithSlider* b;

    QVBoxLayout* layout;

private:
    QColor color;

private slots:
    void ValueChangeHandle(int v);
};


#endif //COLORPANEL_H
